package com.qezhhnjy.hbase.config;

import lombok.Data;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhaoyangfu - 2021/2/4 16:04
 */

@Data
@Configuration
@ConfigurationProperties(prefix = "hbase.zookeeper")
public class HBaseConfig {
    private String host;
    private String port;

    @Bean
    public org.apache.hadoop.conf.Configuration configuration() {
        org.apache.hadoop.conf.Configuration conf = HBaseConfiguration.create();
        conf.set("hbase.zookeeper.quorum", host);
        conf.set("hbase.zookeeper.port", port);
        return conf;
    }

}